import request from '@/utils/httpRequest'

export const luckDraw = {
  // 开关
  luckDrawOpen: function(param) {
    const res = request({
      url: `/activity-manage/luck-draw/${param.luckId}/open`,
      method: 'post',
      data: param || {}
    })
    return res
  },
  // 新增
  luckDrawAdd: function(param) {
    const res = request({
      url: `/activity-manage/luck-draw/`,
      method: 'post',
      data: param || {}
    })
    return res
  },
  // 幸运抽奖活动列表
  luckDrawList: function(param) {
    const res = request({
      url: `/activity-manage/luck-draw/list`,
      method: 'get',
      params: param || {}
    })
    return res
  },
  //幸运抽奖活动-后管-奖品类目
  luckDrawAward: function(param) {
    const res = request({
      url: `/activity-manage/luck-draw/award`,
      method: 'get',
      params: param || {}
    })
    return res
  },
  //幸运抽奖活动-后管-奖励记录
  luckDrawRecord: function(param) {
    const res = request({
      url: `/activity-manage/luck-draw/${param.luckId}/record`,
      method: 'get',
      params: param || {}
    })
    return res
  },
  //幸运抽奖活动-后管-删除活动
  delLuckDraw: function(param) {
    const res = request({
      url: `/activity-manage/luck-draw/${param.luckId}`,
      method: 'delete',
      params: param || {}
    })
    return res
  },
  //幸运抽奖活动-详情
  luckDrawDesc: function(param) {
    console.log(param)
    const res = request({
      url: `/activity-manage/luck-draw/${param.luckId}`,
      method: 'get',
      params: param || {}
    })
    return res
  }
}
